import store from "../utils/factory";

//获取应用实例
const app = getApp();

let that = null;

Component({
    data: {
        selected: 3,
        color: "#515863",
        count: 0,
        selectedColor: "#EB6681",
        list: [{
                id: 0,
                pagePath: "pages/index/index",
                iconPath: "/images/index_unselected.png",
                selectedIconPath: "/images/index_selected.png",
                text: "月嫂"
            },
            {
                id: 1,
                pagePath: "pages/classify/classify",
                iconPath: "/images/yd_unselected.png",
                selectedIconPath: "/images/yd_selected.png",
                text: "医院陪护"
            },
            {
                id: 2,
                pagePath: "pages/shopCar/shopCar",
                iconPath: "/images/order_unselected1.png",
                selectedIconPath: "/images/order_selected1.png",
                text: "我的订单"
            },
            {
                id: 3,
                pagePath: "pages/my/my",
                iconPath: "/images/my_unselected.png",
                selectedIconPath: "/images/my_selected.png",
                text: "我的"
            }
        ]
    },
    attached() {
        that = this;
    },
    pageLifetimes: {
        // 组件所在页面的生命周期函数
        show: function () {},
        hide: function () {},
        resize: function () {}
    },
    methods: {
        switchTab(e) {
            const data = e.currentTarget.dataset;
            const url = `/` + data.path;
            wx.switchTab({
                url
            });
            this.setData({
                selected: data.index
            });
        }
    }
});